package com.my.turntabledemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

/**
 *
 */
public class CircleActivity extends Activity
{

	private CircleMenuLayout mCircleMenuLayout;

	private String[] mItemTexts = new String[] { "联系人 ", "应用管理", "手机加速",
			"电池管理", "闹钟", "相机" };
	private int[] mItemImgs = new int[] { R.mipmap.menu_icon_0_0,
			R.mipmap.menu_icon_1_0, R.mipmap.menu_icon_2_0,
			R.mipmap.menu_icon_3_0, R.mipmap.menu_icon_4_0,
			R.mipmap.menu_icon_5_0 };

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		
		//自已切换布局文件看效果
		setContentView(R.layout.activity_main02);
//		setContentView(R.layout.activity_main);

		mCircleMenuLayout = (CircleMenuLayout) findViewById(R.id.id_menulayout);
		mCircleMenuLayout.setMenuItemIconsAndTexts(mItemImgs, mItemTexts);

		

		mCircleMenuLayout.setOnMenuItemClickListener(new CircleMenuLayout.OnMenuItemClickListener()
		{
			//pos:点击的是哪个条目
			@Override
			public void itemClick(View view, int pos)
			{
				Toast.makeText(CircleActivity.this, mItemTexts[pos],
						Toast.LENGTH_SHORT).show();


			}
			
			@Override
			public void itemCenterClick(View view)
			{
				Toast.makeText(CircleActivity.this,
						"欢迎来到天天手机助手  ",
						Toast.LENGTH_SHORT).show();

			}

			@Override
			public boolean itemLongClick(View view, int pos) {
				startActivity(new Intent(CircleActivity.this,AlarmActivity.class));
				return false;
			}
		});
		
	}

}
